from django.conf import settings
from django.core.files.storage import Storage

class FastDFSStorage(Storage):
    def __init__(self,base_url=None):
        self.base_url = base_url or settings.FDFS_BASE_URL

    #必须实现的函数
    def open(self, name, mode='rb'):
        pass
    def save(self, name, content, max_length=None):
        pass

    #重写url
    def url(self, name):

        #base_url + name

        return self.base_url + name